/*
 * @Author: 姚杰鸿 adolphus520@163.com
 * @Date: 2024-08-12 08:41:19
 * @LastEditors: 姚杰鸿
 * @LastEditTime: 2024-11-08 17:03:30
 * @Description: file content
 */
import { Cell } from "@antv/x6";

export const DEFAULT_LANG = "zh";
export const SU_ROLE = "SU_ROLE";
export const MENU_MG = "菜单管理";

export interface UsrToken {
  name: string;
  token: string;
}

type router = {
  path: string;
  component: string | null;
};

export type menuItem = {
  id: string | null;
  icon: string | null;
  name: string;
  router: router | null;
  items: menuItem[] | null;
};

export type graph = {
  cells: Cell.Properties[];
};
export interface BaseField {
  id: string | null;
  created_tm: string;
  modify_tm: string;
  creator_ac: string;
  creator_nm: string;
  mender_ac: string;
  mender_nm: string;
  version: number | null;
}

export interface TreeData {
  code: string;
  pcode: string;
  ordernn: number;
  children: TreeData[] | undefined;
}

export interface User {
  base_field: BaseField | null | undefined;
  name: string;
  gender: number;
  birthday: string;
  email: string;
  mobile: string;
  account: string;
  photo: string;
  status: number;
  roles: Role[] | null | undefined;
  department: Department | null | undefined;
  intfs: Intf[] | null | undefined;
}

export interface Role {
  base_field: BaseField | null | undefined;
  code: string;
  name: string;
}

export interface Department {
  base_field: BaseField | null | undefined;
  code: string;
  name: string;
}

export interface Intf {
  base_field: BaseField | null | undefined;
  code: string;
  name: string;
}

export type Callback<T> = (error: Error | null, data: T) => void;
